#ifndef _DEVICEMANAGEMENT_H_
#define _DEVICEMANAGEMENT_H_

#include "common.h"

#define GATEWAY_SDK_VERSION   "V1.0.1"

#define SUBDEVID_LEN	 4

typedef enum
{
    STANDARD_TYPE    = 0x00,
    VARLEN_TYPE		= 0x01,
	TRANSPARENT_TYPE = 0x02
} PRO_TYPE;

/**
* @brief subDevIssuedProcessCB
*
* @param[in]    meshID     :  
* @param[in]    data       : client data:P0
* @param[in]    len        : dataLen
* @param[out]			   : NULL
* @return			       : 
*
*/
//extern void subDevIssuedProcessCB(PRO_TYPE proType,uint16_t meshID,uint8_t * data, uint32_t len);

/**
* @brief subDevRegisterCB
*
* @param[in]    meshID     :  
* @param[in]    result     : 0,success;1,failure
* @param[out]			   : NULL
* @return			       : 
*
*/
typedef void (*subDevRegisterCB)(uint16_t meshID,uint8_t result);

#pragma pack(1)
typedef struct
{
	uint8_t action;
	uint16_t count;
}subDevOnLineHead_t;

typedef struct 
{
    uint8_t len;
	uint8_t subDevID[SUBDEVID_LEN];
	uint8_t isOnLine;
}subDevOnLine_t;
#pragma pack()

int8_t gGatewayLiteInit(void);
int8_t gGatewayLiteExit(void);

/**
* @brief gGatewayLiteSubDevIssuedProcess
*
* @param[in]    data       : gizwits throughPass data
* @param[in]    len        : dataLen
* @param[out]	func	   : functionCB
* @return			       :
*
*/
int8_t gGatewayLiteSubDevIssuedProcess(uint8_t * data, uint32_t len);

/**
* @brief gGatewayLiteUpLoadData
*
* @param[in]    proType    : protocolType
* @param[in]    meshID     :
* @param[in]    data       : client data :P0 or throughPass Data
* @param[in]    len        : dataLen
* @param[out]			   : NULL
* @return			       :
*
*/
int32_t gGatewayLiteUpLoadData(PRO_TYPE proType,uint8_t *subDevID, uint8_t * data, uint16_t len);

/**
* @brief gGatewayLiteUpLoadData
*
* @param[in]    subDevNum  : subDev Num
* @param[in]               : subDev Onlien Status
* @param[out]			   : NULL
* @return			       :
*
*/
int8_t gGatewayLiteSubDevIsOnline(uint16_t subDevNum, subDevOnLine_t *subDevOnLineStatus);

/**
* @brief gGatewayLiteUpLoadData
*
* @param[in]    pk         : productKey
* @param[in]    ps         : productSecret
* @param[in]    devNum     : subDev Num
* @param[in]    subDevInfos: subDev Infos
* @param[out]	func	   : functionCB
* @return			       :
*
*/
//int8_t gGatewayLiteSubDevRegister(uint8_t *pk, uint8_t *ps, int32_t devNum, subDevRegisterInfo_t *subDevInfos, subDevRegisterCB func);

void gGatewayLiteTest(void);

#endif
